home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / nwtp06 / tsttrust.pas < prev    next >
Pascal/Delphi Source File  |  1996-07-10  |  2KB  |  59 lines

  1. program tsttrust;
  2.  
  3. { Testprogram for the NwFile unit / NwTP 0.6, (c) 1993,1995 R.Spronk }
  4.  
  5. uses nwMisc,nwBindry,nwFile;
  6.  
  7. Var DirHandle:Byte;
  8.     DirPath:String;
  9.     SequenceNumber:Byte;
  10.     TrusteeInfo: TtrusteeInformation;
  11.  
  12.     t:Byte;
  13.     ObjName:string;
  14.     ObjType:word;
  15.     ObjId:Longint;
  16.     DH,EffRights:byte;
  17. begin
  18.  
  19. DirHandle:=0;
  20. DirPath:='SYS:SYSTEM';
  21.  
  22. IF NOT AllocTemporaryDirHandle(31,0,DirPath,DH,EffRights)
  23.  then writeln('allocTempDH returned err: ',nwfile.result);
  24.  
  25. { Before scanning the trustees, you might add or delete a 
  26.   trustee for testing purposes.
  27.  
  28. ObjId:=$06000006;
  29. IF NOT DeleteTrustee(0,DirPath,ObjId)
  30.  then writeln('DeleteTrustee returned error: ',nwFile.result);
  31.  
  32. ObjId:=$06000006;
  33. IF NOT SetTrustee(0,DirPath,ObjId,TA_READ or TA_SEARCH)
  34.  then writeln('SetTrustee returned error: ',nwFile.result); }
  35.  
  36. SequenceNumber:=0;
  37. While ScanEntryForTrustees(DirHandle,DirPath,
  38.                            SequenceNumber,TrusteeInfo)
  39.  do begin
  40.       with TrusteeInfo
  41.        do begin
  42.           for t:=1 to TrusteeInfo.NumberOfTrustees
  43.            do begin
  44.               write(HexStr(TrusteeID[t],8));
  45.               GetBinderyObjectName(TrusteeId[t],ObjName,oBjType);
  46.               writeln(' ',HexStr(TrusteeRights[t],4),' ',ObjName);
  47.               end;
  48.  
  49.           end;
  50.       end;
  51.  
  52. if nwFile.result<>$9C { no more trustees }
  53.  then writeln('ScanEntryForTrustees returned error :',nwfile.result);
  54.  
  55. DeallocateDirHandle(DH);
  56.  
  57. readln;
  58. end.
  59.